<?php if (!defined('THINK_PATH')) exit(); /*a:3:{s:70:"/home/wwwroot/www.scp.test/application/index/view/index/questions.html";i:1527146866;s:59:"/home/wwwroot/www.scp.test/application/index/view/base.html";i:1527146866;s:61:"/home/wwwroot/www.scp.test/application/index/view/weixin.html";i:1527146866;}*/ ?>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
	<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
	<meta http-equiv="Cache-Control" content="no-transform" />
	<meta http-equiv="Cache-Control" content="no-siteapp" />
	<title><?php if($data['exam_name']): ?><?php echo $data['exam_name']; else: ?>闪测评<?php endif; ?></title>
	<link rel="stylesheet" href="__CSS__/lui-modal.css">
	<style>
		*{ -webkit-tap-highlight-color: rgba(0,0,0,0);-webkit-tap-highlight-color: transparent;}  
		body {margin: 0;font-family: "微软雅黑";}
		header {padding: 15px;position: fixed;width: calc(100% - 30px);background-color: #fff;top: 0;z-index: 10;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;}
		.logo-main {display: inline-block;}
		.default-logo {width: 30px;height: 30px;display: inline-block;}
		.default-logo img {width: 100%;vertical-align: middle;}
		.organ-logo {width: 30px;height: 30px;display: inline-block;}
		.organ-logo img {width: 100%;vertical-align: middle;}
		.kulvar {display: inline-block;width: 1px;margin: 0 1px;height: 20px;background-color: #aaa;vertical-align: middle;}
		.organ-name {display: inline-block;font-size: 18px;color: #25272c;vertical-align: middle;}
		.exam-name {display: inline-block;font-size: 16px;vertical-align: middle;}
		.exam-name p {width: 100%;color: #4782f6;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;margin: 0;vertical-align: middle;display: inline-block;}
		footer {height: 45px;line-height: 45px;text-align: center;background-color: #2f2d30;position: fixed;width: 100%;bottom: 0;}
		footer span {font-size: 16px;color: #fff;margin: 0 5px;}
		.tel-text {color: #4171d0;text-decoration: none;font-size: 14px;margin: 0 5px;}
		@media (max-width: 320px) {
			header {padding: 12px 15px;}
			.default-logo {width: 26px;height: 26px;}
			.organ-logo {width: 26px;height: 26px;}
			.organ-name {font-size: 16px;}
			.exam-name {font-size: 14px;}
			footer {height: 40px;line-height: 40px;font-size: 14px;}
		}
	</style>
	
<style>
	footer {display: none;}
	.lui-nav {background-color: #f3f3f3;position: fixed;width: 100%;top: 60px;z-index: 10;height: 52px;}
	.lui-nav-left {color: #ff7340;font-size: 16px;font-weight: 600;float: left;position: relative;top: 15px;left: 10px;}
	.lui-nav-right {float: right;position: relative;right: 15px;top: 10px;}
	.lui-nav-rate {display: inline-block;vertical-align: middle;font-size: 18px;color: #25272c;}
	.lui-nav-rate .rate-text {font-size: 22px;color: #4782f6;}
	.lui-nav-dtk {display: inline-block;margin-left: 10px;}
	.lui-nav-dtk img {width: 22px;vertical-align: middle;transition: all .15s;}
	.lui-nav-dtk img:active {box-shadow: 0 0 1px 1px #ccc;}
	.lui-content {padding: 112px 0 103px;}
	.lui-exam-main {display: none;}
	.lui-exam-main.lui-active {display: block;}
	.lui-question-item {background-color: #fff;font-size: 16px;color: #25272c;line-height: 1.6;padding: 10px 15px 15px;}
	.lui-kulvar {height: 15px;background-color: #f3f3f3;}
	.lui-option-item {background-color: #fff;font-size: 16px;color: #25272c;line-height: 1.6;padding: 10px 15px 15px;}
	.lui-option-item div {margin: 0 0 8px;}
	.footer {position: fixed;width: 100%;background-color: #fff;z-index: 1;bottom: 0;}
	.lui-support-text {text-align: center;height: 30px;line-height: 30px;}
	.lui-support-text span {font-size: 14px;color: #aaa;margin: 0 5px;}
	.lui-support-text .tel-text {color: #4782f6;text-decoration: none;font-size: 14px;margin: 0 5px;}
	.lui-select-main {border-top: 1px solid #edeff0;}
	.lui-select-item {display: inline-block;width: 25%;margin: 0 -3px 0 -2px;text-align: center;padding: 10px 0;}
	.lui-select-option {width: 50px;height: 50px;line-height: 50px;text-align: center;font-size: 27px;background-color: #fff;color: #4782f6;display: inline-block;border-radius: 50%;border: 1px solid #4782f6;transition: all .2s;}
	.lui-select-option.lui-active {background-color: #4782f6;color: #fff;}
	.lui-select-option:active {background-color: #4782f6;color: #fff;}
	.lui-select-option.lui-active:active {background-color: #fff;color: #4782f6;}
	#dtk .lui-modal-content {position: relative;background-color: #fff;top: 112px;height: calc(100% - 252px);overflow-y: hidden;display: none;}
	.lui-modal-tuckup {position: absolute;width: 100%;bottom: 70px;text-align: center;display: none;}
	.lui-modal-tuckup img {width: 40px;position: relative;transition: all .15s;}
	.lui-modal-tuckup img:active {bottom: 1px;}
	.lui-exam-list {padding: 10px 0;position: relative;height: calc(100% - 105px);overflow-y: hidden;}
	.lui-exam-item {display: inline-block;width: 20%;margin: 0 -3px 0 -2px;text-align: center;padding: 10px 0;}
	.lui-exam-option {width: 46px;height: 46px;line-height: 46px;text-align: center;font-size: 21px;background-color: #fff;color: #4782f6;display: inline-block;border-radius: 50%;border: 1px solid #4782f6;transition: all .2s;}
	.lui-exam-option.lui-active {background-color: #4782f6;color: #fff;}
	.lui-exam-option:active {background-color: #4782f6;color: #fff;}
	.lui-exam-option.lui-active:active {background-color: #fff;color: #4782f6;}
	.submit-btn {width: calc(100% - 40px);margin: 20px;height: 45px;line-height: 45px;text-align: center;color: #fff;font-size: 18px;background-image: -webkit-linear-gradient(to right, #47a2f6, #4782f6);background-image: linear-gradient(to right, #47a2f6, #4782f6);border-radius: 25px;transition: all .2s;}
	.submit-btn:active {box-shadow: 0 0 1px 1px #ccc;}
	.lui-question-item img {vertical-align: middle;max-width: 98% !important;height: auto !important;}
	.lui-option-item img {vertical-align: middle;}
	.lui-option-item p {display: inline-block;margin: 0;}
	.lui-question-item p {display: inline-block;margin: 0;}
	@media (max-width: 320px) {
		.lui-nav {top: 50px;height: 48px;}
		.lui-nav-left {font-size: 14px;}
		.lui-nav-rate {font-size: 16px;}
		.lui-nav-rate .rate-text {font-size: 20px;}
		.lui-nav-dtk img {width: 18px;}
		#dtk .lui-modal-content {top: 98px;height: calc(100% - 192px);}
		.lui-exam-item {margin: 0;}
		.lui-modal-tuckup img {width: 30px;}
		.lui-modal-tuckup {bottom: 40px;}
		.lui-content {padding-top: 98px;padding-bottom: 93px;}
		.lui-select-option {width: 40px;height: 40px;line-height: 40px;}
	}
</style>

	<script>
		var _hmt = _hmt || [];
		(function() {
			var hm = document.createElement("script");
			hm.src = "https://hm.baidu.com/hm.js?f6b06c4cb3e837682fc89a82b8838eaa";
			var s = document.getElementsByTagName("script")[0]; 
			s.parentNode.insertBefore(hm, s);
		})();
	</script>
</head>
<body>
	<header>
		<div class="logo-main">
			<?php if($org_info['level'] < 3): ?>
			<div class="default-logo">
				<img src="__UPLOAD__/default-logo-48.png" />
			</div>
				<?php if($org_info['level'] > 1): ?>
				<div class="kulvar"></div>
				<?php endif; endif; if($org_info['level'] > 1): ?>
			<div class="organ-logo">
				<img src="<?php echo $org_info['logo']; ?>" />
			</div>
			<?php endif; ?>
		</div>
		<div class="organ-name"><?php echo $org_info['name']; ?></div>
		<?php if($data['exam_name']): ?>
		<div class="exam-name">
			- <p><?php echo $data['exam_name']; ?></p>
		</div>
		<?php endif; ?>
	</header>
	
	
	<div class="lui-nav">
		<div class="lui-nav-left">
			<?php if($data['exam_stauts'] == 1): ?>
			（<span>待上架</span>）
			<?php elseif($data['exam_stauts'] == 3): ?>
			（<span>已下架</span>）
			<?php elseif($data['exam_stauts'] == 4): ?>
			（<span>已删除</span>）
			<?php endif; ?>
		</div>
		<div class="lui-nav-right">
			<div class="lui-nav-rate">
				<span class="rate-text">1</span> / <span class="sum-text"><?php echo $data['exam_num']; ?></span>
			</div>
			<div class="lui-nav-dtk">
				<img src="__UPLOAD__/system/icon-dtk.png" />
			</div>
		</div>
	</div>
	<div id="dtk" class="lui-modal-body">
		<div class="lui-modal-box"></div>
		<div class="lui-modal-content">
			<div class="lui-exam-list"></div>
			<div class="submit-btn">提交</div>
		</div>
		<div class="lui-modal-tuckup">
			<img src="__UPLOAD__/system/icon-up.png" />
		</div>
	</div>
	<!--
	<div id="relation" class="lui-modal-body z-99" style="display: block;">
		<div class="lui-modal-box"></div>
		<div class="lui-modal-content">
			<div class="lui-rel-title"><?php echo $org_info['name']; ?>-<?php echo $data['exam_name']; ?></div>
			<div class="lui-rel-text">快来一试身手</div>
			<div class="lui-input-main">
				<div class="lui-input-list">
					<div class="lui-input-list-left"></div>
					<div class="lui-input-list-right">
						<input style="text" class="lui-input" placeholder="请输入姓名"/>
					</div>
				</div>
				<div class="lui-input-list">
					<div class="lui-input-list-left">*</div>
					<div class="lui-input-list-right">
						<input style="tel" class="lui-input" placeholder="请输入手机号码"/>
					</div>
				</div>
			</div>
			<div class="lui-tips">请输入正确的手机号码</div>
			<div class="lui-btn">开始评测</div>
		</div>
	</div>
	-->
	<div class="lui-content">
		<div class="lui-exam-body">
			<?php if(is_array($data['list']) || $data['list'] instanceof \think\Collection || $data['list'] instanceof \think\Paginator): if( count($data['list'])==0 ) : echo "" ;else: foreach($data['list'] as $key=>$vo): ?>
				<div eid="<?php echo $key+1; ?>" data-key="" class="lui-exam-main <?php if($key == 0): ?>lui-active<?php endif; ?>">
					<div question_id = "<?php echo $vo['QuestionId']; ?>" class="lui-question-item">
						<?php echo $key+1; ?>. <?php echo deletep($vo['QuestionContent']); ?>
					</div>
					<div class="lui-kulvar"></div>
					<div class="lui-option-item">
						<?php if(is_array($vo['Options']) || $vo['Options'] instanceof \think\Collection || $vo['Options'] instanceof \think\Paginator): if( count($vo['Options'])==0 ) : echo "" ;else: foreach($vo['Options'] as $key=>$voitem): ?>
							<div><?php echo $voitem['QuestionOptionId']; ?>：<?php echo $voitem['QuestionOptionText']; ?></div>
						<?php endforeach; endif; else: echo "" ;endif; ?>
					</div>
				</div>
			<?php endforeach; endif; else: echo "" ;endif; ?>
		</div>
	</div>
	<div class="footer">
		<div class="lui-support-text"><span>软云科技</span><span>商务洽谈</span><a href="tel:400-182-6266" class="tel-text">400-182-6266</a></div>
		<div class="lui-select-main">
			<div class="lui-select-item">
				<div data="1" class="lui-select-option">A</div>
			</div>
			<div class="lui-select-item">
				<div data="2" class="lui-select-option">B</div>
			</div>
			<div class="lui-select-item">
				<div data="3" class="lui-select-option">C</div>
			</div>
			<div class="lui-select-item">
				<div data="4" class="lui-select-option">D</div>
			</div>
		</div>
	</div>
	<input type="hidden" value="<?php echo $data['examinations_id']; ?>" id="examinations_id">

	
	<?php if($org_info['level'] < 4): ?>
	<footer><span>软云科技</span><span>商务洽谈</span><a href="tel:400-182-6266" class="tel-text">400-182-6266</a></footer>
	<?php endif; ?>
</body>
<script src="__JS__/jquery.min.js"></script>
<script src="__JS__/lui-modal.js"></script>

	


<script>
	var winW = $(window).width();
	var winH = $(window).height();
	var keyList = {};
	
	$(function(){
		var status = '<?php echo $data['status']; ?>';
		var is_verify = '<?php echo $data['is_verify']; ?>';
		var answer_name = '<?php echo $answer_name; ?>';
		var answer_mobile = '<?php echo $answer_mobile; ?>';
		
		if(is_verify == 1 && answer_name == '' && answer_mobile == ''){
			var msg = {};
			msg.title = '<?php echo $org_info['name']; ?>-<?php echo $data['exam_name']; ?>';
			msg.text = '快来一试身手';
			$.showInput(msg,function(name,mobile){
				$.showLading();
				$.ajax({
					url: "<?php echo url('index/Index/save_user'); ?>",
					type: "post",
					dataType: "json",
					cache: false,
					data: {
						answer_name: name,
						answer_mobile: mobile
					},
					success: function (info) {
						$.hideLading();
						if(info.status == 1){
							//$.showMsg('提交成功！');
						}else{
							//$.showMsg(info.msg);
						}
					}
				});
			});
		}
		
		if(status == '2' || status == '0'){
			var msg = '<?php echo $data['msg']; ?>';
			$.showForbid(msg);
		}
	
		var exam_num = '<?php echo $data['exam_num']; ?>';
		for(var i=0;i<Number(exam_num);i++){
			keyList[i+1] = 0;
		}
		
		$('.lui-nav-dtk').on('click',function(){
			var isshow = $(this).hasClass('lui-active');
			if(!isshow){
				renderDtk('show');
			}else{
				renderDtk('hide');
			}
		})
		
		$('#dtk .lui-modal-tuckup').click('click',function(){
			renderDtk('hide');
		});
		
		$('.lui-select-option').on('click',function(){
			var key = $(this).attr('data');
			var eid = $('.lui-exam-main.lui-active').attr('eid');
			keyList[eid] = key;
			
			$('.lui-select-option').removeClass('lui-active');
			if(parseInt(eid) < $('.lui-exam-main').length){
				$.showLading();
				setTimeout(function(){
					$('.rate-text').text(parseInt(eid) + 1);
					$('.lui-exam-main').removeClass('lui-active');
					$('.lui-exam-main').eq(parseInt(eid)).addClass('lui-active');
					var key2 = keyList[parseInt(eid) + 1];
					if(key2 != 0){
						$('.lui-select-option').eq(parseInt(key2) - 1).addClass('lui-active');
					}
					$.hideLading();
				},500);
			}else{
				$(this).addClass('lui-active');
				renderDtk('show');
			}
		})
		
		$('.lui-exam-list').on('click','.lui-exam-option',function(){
			var eid = $(this).attr('data');
			var key = keyList[eid];
			
			$('.rate-text').text(eid);
			$('.lui-exam-main').removeClass('lui-active');
			$('.lui-exam-main').eq(parseInt(eid) - 1).addClass('lui-active');
			$('.lui-select-option').removeClass('lui-active');
			if(key != 0){
				$('.lui-select-option').eq(parseInt(key) - 1).addClass('lui-active');
			}
			renderDtk('hide');
		})
		
		$('#dtk .submit-btn').on('click',function(){
			var isfull = true;
			$.each(keyList,function(i,v){
				if(v == 0){
					isfull = false;
				}
			})
			
			if(isfull){
				submitAnswer();
			}else{
				$.showConfirm(function(ret){
					if(ret.index == 1){
						submitAnswer();
					}
				})
			}
		})
		
		var org_level = '<?php echo $org_info['level']; ?>';
		if(org_level == '4'){
			$('.lui-support-text').hide();
		}
	})
	
	function submitAnswer(){
		$.showLading();
		var examinations_id = $("#examinations_id").val();
		var StudentQuestion = [];
		var Answer = {1:'A',2:'B',3:'C',4:'D'};
		
		$('.lui-exam-main').each(function(i,e){
			var data = {};
			var question_id = $(e).find('.lui-question-item').attr('question_id');
			data.QuestionId = question_id;
			data.StudentAnswer = Answer[keyList[i+1]] ? Answer[keyList[i+1]] : '';
			StudentQuestion.push(data);
		})
		var examinations_result = JSON.stringify(StudentQuestion);
		
		$.ajax({
			url: "<?php echo url('index/Index/result_info'); ?>",
			type: "post",
			dataType: "json",
			cache: false,
			data: {
				examinations_result: examinations_result,
				examinations_id: examinations_id
			},
			success: function (info) {
				$.hideLading();
				if(info.status == 1){
					//$.showMsg('提交成功！');
					setTimeout(function(){
						location.href = '<?php echo url("index/index/exam_result"); ?>'+'?eid='+info.eid;
					},500);
				}else{
					$.showMsg(info.msg);
				}
			}
		});
	}
	
	function renderDtk(type){
		if(type == 'show'){
			var html = '';
			$.each(keyList,function(i,v){
				var active = v ? 'lui-active' : '';
				html += '<div class="lui-exam-item"><div data="'+ i +'" class="lui-exam-option '+ active +'">'+ i +'</div></div>';
			})

			$('.lui-exam-list').html(html);
		
			$('#dtk').show();
			$('#dtk .lui-modal-content').slideDown('linear',function(){
				$('#dtk .lui-modal-tuckup').show();
				$('#dtk .lui-exam-list').css('overflow','auto');
				$('.lui-nav-dtk').addClass('lui-active');
			});
		}else if(type == 'hide'){
			$('#dtk .lui-exam-list').css('overflow','hidden');
			$('#dtk .lui-modal-content').slideUp('linear',function(){
				$('#dtk').hide();
				$('#dtk .lui-modal-tuckup').hide();
				$('.lui-nav-dtk').removeClass('lui-active');
			});
		}
	}
</script>
<?php if($isweixin == 1 and $sign != ''): ?>
 <button class="btn btn_primary" id="checkJsApi" style="display:none;">checkJsApi</button>
 <textarea style=" width:100%; height:500px; display:none;">
  URL:<?php echo $url; ?> <br/>
  appId:<?php echo $sign["AppId"]; ?><br/>
  timestamp:<?php echo $sign["TimeStamp"]; ?><br/>
  nonceStr:<?php echo $sign["NonceStr"]; ?><br/>
  signature:<?php echo $sign["Signature"]; ?><br/>
  wxpic:<?php echo $wxpic; ?><br/>
  wxdesc:<?php echo mb_substr($des,0,50,"utf-8"); ?><br/>
  wxtitle:<?php echo $title; ?><br/>
 </textarea>
 <script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
 <script>
 
  wx.config({
      debug     : false,
      appId     : '<?php echo $sign["AppId"]; ?>',
      timestamp : <?php echo $sign["TimeStamp"]; ?>,
      nonceStr  : '<?php echo $sign["NonceStr"]; ?>',
      signature : '<?php echo $sign["Signature"]; ?>',
      jsApiList : [
        'checkJsApi',
        'onMenuShareTimeline',
        'onMenuShareAppMessage',
        'onMenuShareQQ',
        'onMenuShareWeibo',
        'onMenuShareQZone'
      ]
  });
  
  var wxpic   = '<?php echo $wxpic; ?>';
  var wxdesc  = '<?php echo mb_substr($des,0,50,"utf-8"); ?>';
  var wxtitle = '<?php echo $title; ?>';
  var wxurl   = '<?php echo $url; ?>';
  wx.ready(function () {
	
  document.querySelector('#checkJsApi').onclick = function () {
    wx.checkJsApi({
      jsApiList: [
        'checkJsApi',
        'onMenuShareTimeline',
        'onMenuShareAppMessage',
        'onMenuShareQQ',
        'onMenuShareWeibo',
        'onMenuShareQZone'
      ],
      success: function (res) {
        alert(JSON.stringify(res));
      }
    });
  };
	//分享给朋友
  
	  wx.onMenuShareAppMessage({
	    title  : wxtitle,
	    desc   : wxdesc,
	    link   : wxurl,
	    imgUrl : wxpic,
	    trigger: function (res) {},
	    success: function (res) {},
	    cancel: function (res) {},
	    fail: function (res) {}
	  });
    
	//分享到朋友圈
      wx.onMenuShareTimeline({
        title   : wxtitle,
        link    : wxurl,
        imgUrl  : wxpic,
        trigger : function (res) {},
        success : function (res) {},
        cancel  : function (res) {},
        fail    : function (res) {}
      });
    
    //分享到QQ
	
	  wx.onMenuShareQQ({
		title    : wxtitle,
		desc     : wxdesc,
		link     : wxurl,
		imgUrl   : wxpic,
		trigger  : function (res) {},
		complete : function (res) {},
		success  : function (res) {},
		cancel   : function (res) {},
		fail     : function (res) {}
	  });
    
	//分享到微博
   
      wx.onMenuShareWeibo({
        title    : wxtitle,
        desc     : wxdesc,
        link     : wxurl,
        imgUrl   : wxpic,
        trigger  : function (res) {},
        complete : function (res) {},
        success  : function (res) {},
        cancel   : function (res) {},
        fail     : function (res) {}
      });
    
	//分享到QZone
    
      wx.onMenuShareQZone({
        title    : wxtitle,
        desc     : wxdesc,
        link     : wxurl,
        imgUrl   : wxpic,
        trigger  : function (res) {},
        complete : function (res) {},
        success  : function (res) {},
        cancel   : function (res) {},
        fail     : function (res) {}
     });
   
  
 });
 wx.error(function (res) {
  alert(res.errMsg);
 });
 </script>
<?php endif; ?>

<script>
	$(function(){
		var winW = $(window).width();
		var logoW = $('.logo-main').width();
		var nameW = $('.organ-name').width();
		$('.exam-name').css('width',winW - logoW - nameW - 55);
	})
</script>
</html>